<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-11-11 19:25:17
         compiled from "H:\WebApplication\myconpany\sumi_mobile\application\views\entrust\index.html" */ ?>
<?php /*%%SmartyHeaderCode:30094562df038824626-74203156%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '10a8526f81ab0160b1d58af4a4b7c2a437acfdd4' => 
    array (
      0 => 'H:\\WebApplication\\myconpany\\sumi_mobile\\application\\views\\entrust\\index.html',
      1 => 1447208433,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '30094562df038824626-74203156',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_562df03885a895_37252849',
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_562df03885a895_37252849')) {function content_562df03885a895_37252849($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/header.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<!--header stop-->
<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/common/headertitle.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<!--header end-->
<section class="box-user">
    <form method="post" target="_self"  name="entrust"  id="entrust" action="/entrust/index">
    <div class="purchase">
        <textarea class="purchase_w1" name="content" id="content" placeholder="快速发布求购需求.如：HDPE 7000F伊朗石化 25吨 9867元/吨 上海，多个牌号请换行填写！"></textarea>
        <input class="purchase_w2" name="mobile" type="text" placeholder="输入手机号码"/>
    </div>
    <div class="purchase1">
        <input class="purchase_w3 btn_em tac" type="button" value="发布求购"/>
    </div>
    </form>
</section>



<?php echo '<script'; ?>
 type="text/javascript">
    $(function(){
        $(function(){
            $('.btn_em').click(function(){
                if(nEmpty($("#content"),'求购需求不能为空！','请输入合理的求购需求！','请输入合理的求购需求!')==false||checkSubmitMobil($("input[name=mobile]"))==false){
                    return false;
                }else {
                    document.getElementById("entrust").submit();
                }
            });
        })

        function nEmpty(obj,txt1,txt2,txt3){
            Value = obj.val();
            if(Value==''){
                alert(txt1);
                return false;
            }else if(Value.length<2||Value.length>=200){
                alert(txt2);
                return false;
            }else if(!isNaN(obj.val())){
                alert(txt3);
                return false;
            }else{

                return true;
            }
        }

        function checkSubmitMobil(obj){
            if(obj.val()==""){
                alert("手机号码不能为空！");
                return false;
            }
            if(!obj.val().match(/^(?:13\d|15\d|18\d|17\d|14\d)\d{5}(\d{3}|\*{3})$/)){
                alert("手机号码格式不正确！请重新输入！");
                return false;
            }else{
                return true;
            }
        }


        $("#content").blur(function(){
            nEmpty($("#content"),'求购需求不能为空！','请输入合理的求购需求！','请输入合理的求购需求!');
        });

        $("input[name=mobile]").blur(function(){
            checkSubmitMobil($("input[name=mobile]"));
        });
    });
<?php echo '</script'; ?>
>



<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/common/footerlogin.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>


<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/footer.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php }} ?>
